package com.machine.action.order;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.machine.bean.PriceOrder;
import com.machine.service.order.PriceOrderServer;
import com.opensymphony.xwork2.ActionSupport;

@Component("updatePriceOrderAction")
@Scope(value = "prototype")
public class UpdatePriceOrderAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private PriceOrderServer priceOrderServer;

	private PriceOrder priceOrder;

	
	private Integer id;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	public PriceOrderServer getPriceOrderServer() {
		return priceOrderServer;
	}

	@Resource
	public void setPriceOrderServer(PriceOrderServer priceOrderServer) {
		this.priceOrderServer = priceOrderServer;
	}

	public PriceOrder getPriceOrder() {
		return priceOrder;
	}

	public void setPriceOrder(PriceOrder priceOrder) {
		this.priceOrder = priceOrder;
	}

	@Override
	public String execute() throws Exception {

		priceOrder = priceOrderServer.findById(id);
		return super.execute();
	}

}
